<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>axios</title>
    <script src="lib/vue.js"></script>
    <script src="lib/axios.min.js"></script>

</head>

<body>
    <div id="box">
        <button @click="handleClick">正在热映</button>

        <ul>
            <li v-for="data in datalist" :key="data.channelid">{{data.name}}</li>
        </ul>

    </div>


    <script>
        new Vue({
            el: "#box",
            data: {
                datalist: []
            },
            methods: {
                handleClick() {
                    axios.get("https://api.apiopen.top/musicBroadcasting").then(res => {
                        console.log(res.data.result[0].channellist);
                        this.datalist = res.data.result[0].channellist
                    }).catch(err => {
                        console.log(err);
                    })
                }
            }
        })
    </script>

</body>

</html>